package com.cloudkinto.dto.order.outbound.oldSys;

import java.util.Objects;

/**
 * @author long
 * @Description 配送时间带
 * @Date 2025/2/19 14:32
 */
public enum DeliveryTimeBand {
    /**
     *
     */
    one("00", "指定なし"),
    two("01", "午前中"),
    three("12", "1214"),
    four("14", "1416"),
    five("16", "1618"),
    six("18", "1820"),
    seven("04", "1821"),
    nine("19", "1921");

    private final String code;

    private final String timeBand;

    DeliveryTimeBand(String code, String timeBand) {
        this.code = code;
        this.timeBand = timeBand;
    }

    public static String getCodeByTimeBand(String timeBand) {
        for (DeliveryTimeBand deliveryTimeBand : values()) {
            if (Objects.nonNull(timeBand) && timeBand.equals(deliveryTimeBand.timeBand)) {
                return deliveryTimeBand.code;
            }
        }
        return "";
    }
}
